#include <iostream>
#include <map>
#include <set>
using namespace std;

void test1()
{
	map<int, int> map1;
	map1.insert({ 0,0 });
	map1.insert({ 1,1 });
	map1.insert({ 2,2 });
	map1.insert({ 3,3 });
	map1.insert({ 4,4 });
	map1.insert({ 5,5 });

	map<int, int>::iterator it1 = map1.begin();

	while (it1 != map1.end())
	{
		cout << it1.operator->()->first << ' ';
		++it1;
	}
	cout << endl;
	it1 = map1.begin();
	while (it1 != map1.end())
	{
		cout << it1->first << ' ';
		++it1;
	}
	cout << endl;
	pair<map<int, int>::iterator, bool> pit1;
	pit1 = map1.insert({ 5,5 });
	cout << pit1.first->first << ' ' << pit1.first->second << endl;
	map1[5] = 20;
	pit1 = map1.insert({ 5,5 });
	cout << pit1.first->first << ' ' << pit1.first->second << endl;
}

int main()
{
	test1();
	return 0;
}
